Fix: signer identity validation for signed PeerRecords#1339
Fix: signer identity validation for signed PeerRecords#1339sumanjeet0012 wants to merge 5 commits into
Conversation
|
Hi @sumanjeet0012 — yours predates and covers #1338, and enforcing this in One thing from #1348 that might be useful here: it includes a regression test — Happy to push it to your branch, or open it as a small follow-up once this merges — whatever's easiest for you. Feel free to lift it straight from #1348. Let me know if a second pair of eyes on the diff would help. |
What was wrong?
Fixes #1338
KadDHT accepted signed PeerRecords where the signer identity did not match record.peer_id.
Although the envelope signature was valid, the signer public key embedded in the envelope could derive to a different peer ID than the one claimed in the record payload.
This allowed authenticated but incorrectly bound peer records to poison the certified address book for arbitrary peer IDs.
How was it fixed?
Added signer identity binding validation before accepting signed peer records.
The fix enforces:
signer_peer_id = ID.from_pubkey(envelope.public_key)Records with mismatched signer identities are now rejected before they can update certified peer addresses.
To-Do
Cute Animal Picture